import 'package:tin_flutter/generated/json/base/json_convert_content.dart';
import 'package:tin_flutter/ui/bean/response/login_response_entity.dart';

LoginResponseEntity $LoginResponseEntityFromJson(Map<String, dynamic> json) {
  final LoginResponseEntity loginResponseEntity = LoginResponseEntity();
  final String? bindName = jsonConvert.convert<String>(json['bindName']);
  if (bindName != null) {
    loginResponseEntity.bindName = bindName;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    loginResponseEntity.nickName = nickName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    loginResponseEntity.id = id;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    loginResponseEntity.type = type;
  }
  final String? bindId = jsonConvert.convert<String>(json['bindId']);
  if (bindId != null) {
    loginResponseEntity.bindId = bindId;
  }
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    loginResponseEntity.username = username;
  }
  return loginResponseEntity;
}

Map<String, dynamic> $LoginResponseEntityToJson(LoginResponseEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['bindName'] = entity.bindName;
  data['nickName'] = entity.nickName;
  data['id'] = entity.id;
  data['type'] = entity.type;
  data['bindId'] = entity.bindId;
  data['username'] = entity.username;
  return data;
}

extension LoginResponseEntityExtension on LoginResponseEntity {
  LoginResponseEntity copyWith({
    String? bindName,
    String? nickName,
    String? id,
    int? type,
    String? bindId,
    String? username,
  }) {
    return LoginResponseEntity()
      ..bindName = bindName ?? this.bindName
      ..nickName = nickName ?? this.nickName
      ..id = id ?? this.id
      ..type = type ?? this.type
      ..bindId = bindId ?? this.bindId
      ..username = username ?? this.username;
  }
}